<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<html>
<head><title>Struts 1 Training Materials</title>
</head>

<body>
<div align="center">
    <center>
        <table border="1" cellspacing="1" width="400">
            <tr>
                <td width="390"><font size="4"><b>Struts 1 Action & Action Form</b></font></td>
            </tr>
            <tr>
                <td width="384">
                    <ul>
                        <li>
                            <a href="#"> What are Struts Actions ??</a>
                            <br>
                            - All the action classes we define should extend from org.apache.struts.action.Action class
                            <br>
                            - An action works as an adapter between the contents of an incoming HTTP request and the business logic that corresponds to it.
                            <br>
                            - Struts controller (ActionServlet) selects an appropriate Action and creates an instance if necessary, and finally calls execute method.
                            <br>
                               >> GOTO Code
                            <br>
                            - The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.
                            <br>
                            - If the business logic fails action class throws java.lang.Exception.
                        </li>
                        <li>
                            <a href="#"> What are Struts Action Forms ??</a>
                            <br>
                            - An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm which we define in the struts-config.xml.
                            <br>
                            - ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.
                            <br>
                            - It also has a validate method which you can override before it continues to Action class.
                            <br>
                            - Need to define the action form bean in the struts config mapping where you have defined your action
                            <br>
                            - Mark the validate property to "True" and input property value as the input page.
                        </li>
                        <li>
                            <a href="#"> Configure Message Resources</a>
                            <br>
                            - Allows the developer internationalising his web application easy and fast.
                            <br>
                            - He can put labels of fields or description texts in a central file and can access them later in the JSP File.
                            The advantage is that you can reuse labels like error messages, titles in multiple JSP files and you can provide the resource files in multiple languages.
                            <br>
                            - In web.xml when you specify the Action Servlet >>GOTO web.xml
                            <br>
                            - In struts-config.xml >>GOTO struts-config.xml
                            <br>
                            - if multiple resource files add the parameter key  >>GOTO struts-config.xml
                            <br>
                            - Internationalising
                            <br>
                               ex: ApplicationResources_fr.properties, ApplicationResources_br.properties
                            <br>
                        </li>
                    </ul>
                </td>
            </tr>
             <tr>
                <td>
                    <html:link page="/index.jsp">HOME</html:link>
                </td>
            </tr>
        </table>
    </center>
</div>
</body>
</html>